package com.sanbi.erp.core.util;

import com.sanbi.common.vo.ResponseVo;
import com.sanbi.erp.core.system.ErrorEnum;

/**
 * @Desc:错误消息提示工具类
 * @Data: 2022/8/23 15:54
 * @Author: WuHang
 */
public class ResponseUtils {

    public static <T> ResponseVo<T> failUtil(ErrorEnum.ErrorCode errorCode){
        return ResponseVo.fail(errorCode.getCode(), errorCode.getMessage());
    }

    public static <T> ResponseVo<T> failUtilVo(ErrorEnum.ErrorCode errorCode, T data){
        return ResponseVo.fail(errorCode.getCode(), errorCode.getMessage(), data);
    }

}
